#include<stdio.h>
const int maxn=100010;
int main()
{
	int a[maxn],s[maxn];
	int m,n,sum=0;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
    scanf("%d",&a[i]);
    s[i]=a[i]-a[i-1];
  }	
	while(m--){
		int l,r,ant;
		scanf("%d%d%d",&l,&r,&ant);
		s[l]+=ant;
		s[r+1]-=ant;
	}
	for(int i=1;i<=n;i++){
		a[i]=a[i-1]+s[i];
		if(a[i]<0)
			printf("0 ");
		else
			printf("%d ",a[i]);
	}
	return 0;
}
